import { ShapeFlags } from "../shared/ShapeFlags";



export function initSlots (instance,children){
    //children object
    const {vnode} = instance
    if (vnode.shapeFlag & ShapeFlags.SLOT_CHILDREN){
        normalizeObjetSlots(children,instance.slots);
    }
    
}
function normalizeObjetSlots(children:any,slots:any){
    for (const key in children) {
        const value = children[key]
        // slot
        slots[key] = (props)=> normalizeSlotValue(value(props));
    }

}

function normalizeSlotValue (value) {
    return Array.isArray(value)?value:[value];
}